import request from '@/utils/request'

// 获取企业海关商品编码分页列表
export function pageCustomsGoodsCode(query) {
  return request({
    url: '/goods/enterpriseCustomsGoodsCode/paging',
    method: 'get',
    params: query
  })
}

// 获取企业海关商品编码列表
export function getCustomsGoodsCodeList(query) {
  return request({
    url: '/goods/enterpriseCustomsGoodsCode/getCustomsGoodsCodeList',
    method: 'get',
    params: query
  })
}

// 获取企业海关商品编码详情
export function getDetail(codeId) {
  return request({
    url: '/goods/enterpriseCustomsGoodsCode/getDetail',
    method: 'get',
    params: {
      codeId: codeId
    }
  })
}

// 添加或修改海关商品编码
export function save(data) {
  return request({
    url: '/goods/enterpriseCustomsGoodsCode/save',
    method: 'post',
    data: data
  })
}

// 批量或单个，删除海关商品编码
// 批量：codeIds = []，单个：codeId =
export function deleteByBatch(enterpriseId, codeIds) {
  return request({
    url: '/goods/enterpriseCustomsGoodsCode/delete',
    method: 'post',
    data: {
      enterpriseId: enterpriseId,
      codeIds: codeIds
    }
  })
}
